<template>
  <el-dialog
    :visible.sync="visible"
    :close-on-click-modal="false"
    append-to-body
    :before-close="beforeClose"
    top="30px"
    width="1000px"
  >
    <review-file-view :relatedData="relatedData" v-if="isUserTown"></review-file-view>
    <el-tabs v-else>
      <el-tab-pane label="区县审批表">
        <review-file-view :relatedData="relatedData"></review-file-view>
      </el-tab-pane>
      <el-tab-pane label="市担保审批表">
        <review-credit-view :relatedData="relatedData"></review-credit-view>
      </el-tab-pane>
    </el-tabs>
  </el-dialog>
</template>
<script>
import ReviewFileView from '@/credit/views/county/mission/components/ReviewFileView'
import ReviewCreditView from '@/credit/views/county/mission/components/ReviewCreditView'
import { mapGetters } from 'vuex'
export default {
  components: {
    ReviewFileView,
    ReviewCreditView,
  },
  props: {
    visible: Boolean,
    relatedData: {
      type: Object,
      default: () => ({}),
    },
  },
  computed: {
    ...mapGetters(['user']),
    isUserTown() {
      return +this.user.orgRegionLever === 3
    },
  },
  methods: {
    beforeClose() {
      this.$emit('update:visible', false)
    },
  },
}
</script>
<style lang="scss" scoped></style>
